package dawnland02.data.map.io;

/**
 * User: Petru Obreja (obrejap@yahoo.com)
 * Date: Sep 16, 2009
 * Time: 8:31:01 PM
 */
public enum MatrixXMLTag {
    MATRIX("matrix"),
    ROWS_ATTRIBUTE("rows"),
    COLUMNS_ATTRIBUTE("columns"),
    NODE("node"),
    ID_ATTRIBUTE("id"),
    X_ATTRIBUTE("x"),
    Y_ATTRIBUTE("y"),
    TYPE_ATTRIBUTE("type"),
    ROAD_LEVEL_ATTRIBUTE("roadLevel");

    private String value;

    MatrixXMLTag(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static MatrixXMLTag fromValue(String value) {
        for (MatrixXMLTag matrixXMLTag : MatrixXMLTag.values()) {
            if (matrixXMLTag.getValue().equals(value)) {
                return matrixXMLTag;
            }
        }
        return null;
    }
}
